<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./lib/react.development.js"></script>
    <script src="./lib/react-dom.development.js"></script>
    <script src="./lib/babel.min.js"></script>
</head>

<body>
    <div id="root"></div>
</body>
<script type="text/babel">
    const root = ReactDOM.createRoot(document.querySelector("#root"));
    function School() {
        console.log('school执行了')
        
        function hello(){
            console.log('hello this: ', this) // this指向 undefined
        }
        return (
            <>
                <h3>学校信息</h3>
                <p>学校名：尚硅谷</p>
                <p>学校地址：宏福科技园</p>
                <p><button onClick={hello}>hello</button></p>
                <p><button onClick={()=>hello()}>箭头函数包裹后,也是undefined</button></p>
            </>
        )
    }
    root.render((
        <div>
            <School />
            <School></School>
        </div>
    ))
</script>

</html>